<?php 
require('_drawrating.php');
header("Cache-Control: no-cache");
header("Pragma: nocache");
include 'init.php';
include 'header.php'; 
?>

<?php

$act = $_GET['act'];
$showuser = $_GET['showuser'];
$showroom = $_GET['showroom'];
$viewcomments = $_GET['viewcomments'];
$var = $_GET['q'];
$s = $_GET['s'];

if ($act == "search") {include 'search.php'; die();}
if ($act == "news") {include 'news.php'; die();}
if ($act == "chat") {include 'chat.php'; die();}
if (is_numeric($viewcomments)) {include 'comments.php'; die();}

if (!is_authed() && !is_numeric($showuser) && empty($showroom) || !is_authed() && !is_numeric($showroom) && empty($showuser)){
	if ($act != "search" || $act != "news") { include 'login.php'; }    die();} elseif (!is_authed() && is_numeric($showroom)){
	include 'joinroom.php';    die();} elseif (!is_authed() && is_numeric($showuser)){
	include 'profile.php';    die();} elseif (!empty($var)){
	include 'search.php';    die();}

// Restricted articles code here

if ($act == "game") {include 'game.php';}
elseif (is_numeric($showroom)) {include 'joinroom.php';}
elseif ($act == "rss") {include 'rss.php';}
elseif ($act == "sendmessage") {include 'mail.php';}
elseif ($act == "sitemap") {include 'sitemapgen.php';}
elseif ($act == "extras") {include 'extra.php';}
elseif ($act == "connect") {include 'connect.php';}
elseif ($act == "gamecode") {include 'gamecode.php';}
elseif ($act == "editprofile") {include 'editprof.php';}
elseif ($act == "createroom") {include 'createroom.php';}
elseif (is_numeric($showuser)) {include 'profile.php';}
elseif ($act == "logout") {user_logout(); echo '<script>							<!-- 								 window.location= "http://www.mariokartchallenger.com"							//-->							</script>';}
else {include 'game.php';}
?>
